<!doctype html>
<html>

{include file="common/head" /}

<body data-type="index">

    {include file="common/nav" /}

    <div class="tpl-page-container tpl-page-header-fixed">

        <!-- 左侧菜单列表 -->
        {include file="common/left_menu_list" /}

        <div class="tpl-content-wrapper">
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">后台首页</a></li>
                <li class="am-active">菜单管理</li>
            </ol>
            <!-- 内容管理区 s -->
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span>菜单列表
                    </div>
                </div>

                <div class="tpl-block">
                    <div class="am-g">
                        <div class="am-u-sm-12 am-u-md-6">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <button type="button" class="am-btn am-btn-default am-btn-success" id="menu_add">
                                        <span class="am-icon-plus"></span> 新增
                                    </button>
                                    <button type="button" class="am-btn am-btn-default am-btn-secondary">
                                        <span class="am-icon-save"></span> 保存
                                    </button>
                                    <button type="button" class="am-btn am-btn-default am-btn-warning">
                                        <span class="am-icon-archive"></span> 审核
                                    </button>
                                    <button type="button" class="am-btn am-btn-default am-btn-danger">
                                        <span class="am-icon-trash-o"></span> 删除
                                    </button>
                                </div>
                            </div>
                        </div>

                        <!-- 菜单类型 -->
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-form-group">
                                <select form="search_form" name="menu_type" data-am-selected="{btnSize: 'sm'}" style="display: none;">
                                    <option value="0" {if 0==$menu_type}selected{/if}>全部类型</option>
                                    <option value="1" {if 1==$menu_type}selected{/if}>后台菜单</option>
                                    <option value="2" {if 2==$menu_type}selected{/if}>前端导航</option>
                                </select>
                            </div>
                        </div>

                        <!-- 搜索 -->
                        <div class="am-u-sm-12 am-u-md-3">
                            <div class="am-input-group am-input-group-sm">
                                <!-- <input form="search_form" name="menu_name" type="text" class="am-form-field"> -->
                                <span class="am-input-group-btn">
                                    <button form="search_form" class="am-btn  am-btn-default am-btn-success tpl-am-btn-success am-icon-search" type="submit"></button>
                                </span>
                            </div>
                        </div>
                    </div>
                    <!-- 搜索提交 -->
                    <form action="/admin/menu_manage/index" id="search_form" method="get"></form>

                    <div class="am-g">
                        <div class="am-u-sm-12">
                            <form class="am-form">
                                <table class="am-table am-table-striped am-table-hover table-main">
                                    <thead>
                                        <tr>
                                            <th width="6%">排序</th>
                                            <th class="table-id">MID</th>
                                            <th class="table-title">菜单名</th>
                                            <th class="table-type">模块名</th>
                                            <th class="table-author am-hide-sm-only">类型</th>
                                            <th class="table-date am-hide-sm-only">状态</th>
                                            <th class="table-set">操作</th>
                                        </tr>
                                    </thead>
                                    <tbody id="menu_list">
                                        <!-- 循环内容 s -->
                                        {volist name="menuList" id="menus"}
                                        <tr>
                                            <td class="order" width="6%">
                                                <input type="number" value="{$menus.sort}" name="list_order[{$menus.mid}]">
                                            </td>
                                            <td>{$menus.mid}</td>
                                            <td><a href="#">{$menus.name}</a></td>
                                            <td>{$menus.m}</td>
                                            <td class="am-hide-sm-only">
                                                {if 1==$menus.type}
                                                后台菜单
                                                {elseif 2==$menus.type /}
                                                前端导航
                                                {/if}
                                            </td>
                                            <td class="am-hide-sm-only">
                                                {if 0==$menus.status}
                                                关闭
                                                {elseif 1==$menus.status /}
                                                正常
                                                {elseif -1==$menus.status /}
                                                删除
                                                {/if}
                                            </td>
                                            <td>
                                                <div class="am-btn-toolbar">
                                                    <div class="am-btn-group am-btn-group-xs">
                                                        <button class="menu_edit am-btn am-btn-default am-btn-xs am-text-secondary" data-mid="{$menus.mid}"><span class="am-icon-pencil-square-o"></span> 编辑</button>
                                                        <button class="menu_del am-btn am-btn-default am-btn-xs am-text-danger am-hide-sm-only" data-mid="{$menus.mid}"><span class="am-icon-trash-o"></span> 删除</button>
                                                    </div>
                                                </div>
                                            </td>
                                        </tr>
                                        {/volist}
                                        <!-- 循环内容 e -->
                                    </tbody>
                                </table>
                                <div class="am-cf">
                                    <!-- 分页 -->
                                    {$menuList->render()}
                                </div>
                                <hr>
                                <div class="am-fl">
                                    <!-- 排序 -->
                                    <button type="button" class="am-btn am-btn-primary" id="menu_order">排序</button>
                                </div>
                            </form>
                        </div>
                    </div>

                </div>
                <div class="tpl-alert"></div>
            </div>
            <!-- 内容管理区 e -->
        </div>

    </div>

    <script>
        var Redirect = {
            "add_url"  : "/admin/menu_manage/add",
            "edit_url" : "/admin/menu_manage/edit",
            "del_url"  : "/admin/menu_manage/del",
            "order_url": "/admin/menu_manage/order",
        };
    </script>
    {include file="common/script" /}
</body>

</html>